import { createApp } from 'vue'
import App from './App.vue'

import axios from 'axios'

import "@nutui/nutui/dist/style.css";

import './assets/style/css.scss'

import router from './router'

import { Button, Icon, RadioGroup, Radio, CellGroup, Cell } from "@nutui/nutui";

const app = createApp(App)

app.use(router)

axios.interceptors.request.use(function (config) {
    config.headers.authorization = 'Token be54638ca86f918af71c145d4530431467bf9bfb'
    return config;
});

axios.interceptors.response.use(function (response) {
    if(response.data) {
        if(!response.data.hasOwnProperty('success')) {
            response.data.success = response.data.code == 200 || response.data.code == 0
        }
    }

    return response
})

app.mount('#app')
